<?php
namespace jy_yxw;
defined('BY_JYA') or exit('error');
/*
	门店
*/
class store extends \plugin{
	public function create($params){
		$postdata=$params;
		$postdata['pcd']=ijson_encode($postdata['pcd']);
		$postdata['onlinetime']=ijson_encode($postdata['onlinetime']);
		$postdata['hdps']=ijson_encode($postdata['hdps']);
		$postdata['lat_lng']=ijson_encode($postdata['lat_lng']);
		$data=array_fields(array('title','logo','pcd','lat_lng','address','tel','type','realname','mobile','onlinetime','hdps','desc','content','paixu','status','shouhouid','shopstoreid'),$postdata);
		$id=intval($postdata['id']);
		if($id){
			pdo_update('jy_yxw_store',$data,array('id'=>$id,'uniacid'=>$_SESSION['uniacid']));
		}else{
			$data['uniacid']=$_SESSION['uniacid'];
			pdo_insert('jy_yxw_store',$data);
			$id=pdo_insertid();
		}
		return $id;
	}
}